package com.dtwenty.gaming.client.widgets;

import com.dtwenty.gaming.data.PlayerCharacter;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class CharacterSheet extends Composite {

	private PlayerCharacter character;
	
	private DockPanel basePanel = new DockPanel();
	private HorizontalPanel centerPanel = new HorizontalPanel();
	private VerticalPanel leftColumn = new VerticalPanel();
	private VerticalPanel centerColumn = new VerticalPanel();
	private VerticalPanel rightColumn = new VerticalPanel();
	
	public CharacterSheet(PlayerCharacter character) {
		this.character = character;
		
		setup();
	}
	
	private void setup() {
		this.initWidget(basePanel);
		
		basePanel.add(new InformationPanel(character), DockPanel.NORTH);
		
		leftColumn.add(new InitiativePanel(character));
		leftColumn.add(new AbilityScorePanel(character));
		
		centerColumn.add(new DefensesPanel(character));
		
		rightColumn.add(new MovementPanel());
		
		centerPanel.add(leftColumn);
		centerPanel.setCellHorizontalAlignment(leftColumn, VerticalPanel.ALIGN_CENTER);
		centerPanel.add(centerColumn);
		centerPanel.setCellHorizontalAlignment(centerColumn, VerticalPanel.ALIGN_CENTER);
		centerPanel.add(rightColumn);
		centerPanel.setCellHorizontalAlignment(rightColumn, VerticalPanel.ALIGN_CENTER);
		centerPanel.setWidth("100%");
		
		basePanel.add(centerPanel, DockPanel.CENTER);
		
		
		this.setStylePrimaryName("character_sheet");
	}
}
